package com.smartrm.trade.domain;

/*
 * @program: common-starters
 * @description: 货道售卖机状态
 * @author: houhong
 * @create: 2023-01-10 15:44
 */
public enum SlotVendingMachineState {
    /*
     * 准备阶段
     */
    Ready(0),
    /*
     * 交易阶段
     */
    Trading(1),
    /*
     * 弹出阶段
     */
    Poping(1);


    private final int code;

    private SlotVendingMachineState(int code) {
        this.code = code;
    }

    public int code() {
        return code;
    }

    public static SlotVendingMachineState of(int code) {
        for (SlotVendingMachineState state : values()) {
            if (state.code == code) {
                return state;
            }
        }
        return null;
    }
}